home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 8
/
Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO
/
047a
/
probots.arj
/
M1_GO.PR
< prev
next >
Wrap
Text File
|
1988-11-05
|
2KB
|
82 lines
PROCEDURE M1_GO;
{ M1-GO is based on a Japanese 60's TV drama "Ultra-Q"
Original C-Robot by Hortense Endoh }
VAR
deg, dego, dir, doo, dmg : Integer;
Range, ranrnd, incr, ro, spd : Integer;
PROCEDURE Go_hell;
BEGIN
WHILE (loc_y > 10) DO
IF (loc_y < 60)
THEN drive(270, 10)
ELSE drive(270, 100);
END; {Go_Hell}
PROCEDURE shoot;
BEGIN
Range := scan(deg, 10);
drive(dir, spd);
IF (Range <> 0) THEN BEGIN
ro := Range-(ro-Range) DIV 2;
doo := deg-(doo-deg) DIV 2;
IF (ro > 40) THEN cannon(doo, ro);
dego := deg;
END
ELSE BEGIN
IF (dego-deg > 0) THEN BEGIN
incr := 20;
dego := deg+30;
END
ELSE BEGIN
IF (dego-deg < 0) THEN BEGIN
incr := -20;
dego := deg-30;
END;
END;
IF (deg > 180) THEN BEGIN
deg := 0;
dego := 30;
END
ELSE BEGIN
IF (deg < 0) THEN BEGIN
deg := 180;
dego := 150;
END
ELSE deg := deg+incr;
END;
END;
END; {Shoot}
BEGIN {M1_GO Main}
deg := 0; dego := 20; incr := 20; spd := 100;
Go_hell;
REPEAT
dir := 0; dmg := damage;
WHILE (loc_x < 800) DO BEGIN
shoot;
IF (dmg <> damage) THEN BEGIN
dir := 180;
WHILE (loc_x > 200) DO shoot;
dir := 0; dmg := damage;
END;
END;
dir := 180; dmg := damage;
WHILE (loc_x > 200) DO BEGIN
shoot;
IF (dmg <> damage) THEN BEGIN
dir := 0;
WHILE (loc_x < 800) DO shoot;
dir := 180; dmg := damage;
END;
END;
UNTIL Dead OR Winner;
END; { end of M1_GO Main }